package cn.study.concurrenthashmap;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author     ：Yuejia Zhou
 * @Description：key value为空的情况
 */
public class ConcurrentHashMapExample {
    public static void main(String[] args) {
        ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
 
        // 添加键值对
        map.put(null, "value1");
        map.put("key2", null);
 
        // 获取键对应的值
        System.out.println(map.get(null)); // 输出: value1
        System.out.println(map.get("key2")); // 输出: null
    }
}